# encoding: utf-8
import string
import random

# 获取验证码
def get():
    # 获取大小字母列表
    source =  list(string.ascii_letters)
    # 获取0～9数字列表
    number_list = map(lambda x: str(x), range(0, 10))
    source.extend(number_list)

    # 随机获取6个元素
    captcha_list = random.sample(source, 6)

    # 生成验证码
    captcha = "".join(captcha_list)

    return captcha